Most modern computers, and especially general-purpose computer systems, execute an operating system which manages the computer's resources and provides a set of common services for application programs which are to be executed on the computer. Operating systems typically act as an intermediary layer between application programs and the computer resources, providing and managing services such as memory allocation and input and output (I/O) functions, such as reading and/or writing information to and from disc drives, or their equivalent.
Most operating systems employ a security model which features at least two modes in which the computer can operate. In the first mode, often referred to as “supervisor mode” or “kernel mode”, the operating system has unrestricted access to the hardware and other resources of the computer system. Generally, only the operating system itself (or the kernel portion of the operating system) executes in supervisor mode. The second mode, often referred to as “protected mode” or “user mode” is the mode in which user applications and less important operating system components execute and software being executed in user mode cannot directly access the resources of the computer system such as the above-mentioned I/O and/or memory allocation functions.
Instead, when a user application requires access to I/O or other computer resources only available in kernel mode, the user application makes a request for those resources to the operating system. Such a request is typically referred to as a “system call” and the operating system receives the system call and attempts to fulfill the request.
When the operating system needs to perform tasks which can only be performed in kernel mode, the mode of the computer system must be switched from user mode to kernel mode and, when the request has been fulfilled, the mode must be switched back from kernel mode to user mode. These switches, often referred to as “mode switches” or “context switches”, are performed by the operating system executing a special instruction which results in a processor “exception” which allows the computer system to change from user mode to kernel mode where the requested system call can be processed and/or back again.
Operating systems which employ this security model have been in widespread use for many years and are the presently preferred method of implementing general-purpose (and many special purpose) computer systems. However, problems exist with these systems. In particular, modern computer systems are typically now superscalar which means that more than one instruction can be executed by the processor in parallel in different parts of the processor. Superscalar systems typically include a set of features such as instruction pipelines, multi-level data and instruction caches, out of order and/or predictive execution units, translation look aside buffers, etc. which assist in achieving superscalar performance.
Modern superscalar systems now commonly also have multiple processors (i.e.—cores”) further increasing the ability of the computer system to execute multiple instructions in parallel. As used herein, the term “superscalar” is intended to comprise computer systems which can execute more than one instruction in parallel and includes both single core and multi-core computer systems.
While superscalar computer systems provide significant advantages, they do suffer from some problems. In particular, many of the superscalar features of such systems require the executing program to display locality of execution to benefit from these features. Without locality of execution, features such as caches, predictive execution units, etc. cannot provide their advantages and the rate of instructions executed per cycle by a superscalar computer system will drop significantly without locality of execution.